package com.yb.nowcoder;

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

/**
 * 华为机试练习第5题
 */
public class Main14 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int count = in.nextInt();
            List<Integer> list = new LinkedList<>();
            for (int i = 0; i < count; i++) {
                Integer num = in.nextInt();
                list.add(num);
            }
            int idx = count - in.nextInt();
            if (idx >= 0 && idx < count) {
                System.out.println(list.get(idx));
            } else {
                System.out.println(0);
            }
        }
    }
}
